<script setup lang="ts">

</script>

<template>
  <div class="background-decoration">
    <!-- 浮动几何图形 -->
    <div class="floating-element element-1"></div>
    <div class="floating-element element-2"></div>
    <div class="floating-element element-3"></div>
    <div class="floating-element element-4"></div>
    <div class="floating-element element-5"></div>

    <!-- 图标装饰 -->
    <div class="floating-icon icon-1">
      <q-icon name="video_call" size="32px"/>
    </div>
    <div class="floating-icon icon-2">
      <q-icon name="cloud" size="28px"/>
    </div>
    <div class="floating-icon icon-3">
      <q-icon name="security" size="24px"/>
    </div>
    <div class="floating-icon icon-4">
      <q-icon name="devices" size="26px"/>
    </div>
    <div class="floating-icon icon-5">
      <q-icon name="speed" size="22px"/>
    </div>

    <!-- 线条装饰 -->
    <div class="decorative-lines">
      <div class="line line-1"></div>
      <div class="line line-2"></div>
      <div class="line line-3"></div>
    </div>

    <!-- 网格背景 -->
    <div class="grid-pattern"></div>

    <!-- 光晕效果 -->
    <div class="light-orb orb-1"></div>
    <div class="light-orb orb-2"></div>
  </div>
</template>

<style lang="scss">
// 背景装饰
.background-decoration {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  background: #A589EF url(src/assets/images/index/bg.jpg) no-repeat;
  background-size: cover;

  // 浮动几何图形
  .floating-element {
    position: absolute;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(15px);
    animation: float 8s ease-in-out infinite;

    &.element-1 {
      width: 280px;
      height: 280px;
      border-radius: 50%;
      top: 8%;
      left: 3%;
      animation-delay: 0s;
      background: rgba(102, 126, 234, 0.05);
    }

    &.element-2 {
      width: 180px;
      height: 180px;
      border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
      top: 45%;
      right: 8%;
      animation-delay: 2.5s;
      background: rgba(118, 75, 162, 0.06);
    }

    &.element-3 {
      width: 120px;
      height: 120px;
      border-radius: 50%;
      bottom: 12%;
      left: 12%;
      animation-delay: 5s;
      background: rgba(255, 255, 255, 0.04);
    }

    &.element-4 {
      width: 90px;
      height: 90px;
      border-radius: 20%;
      top: 25%;
      left: 75%;
      animation-delay: 1.5s;
      background: rgba(102, 126, 234, 0.04);
      transform: rotate(45deg);
    }

    &.element-5 {
      width: 60px;
      height: 60px;
      border-radius: 50%;
      bottom: 35%;
      right: 25%;
      animation-delay: 4s;
      background: rgba(118, 75, 162, 0.03);
    }
  }

  // 浮动图标
  .floating-icon {
    position: absolute;
    animation: iconFloat 12s ease-in-out infinite;
    color: #acacac!important;

    &.icon-1 {
      top: 20%;
      left: 15%;
      animation-delay: 0s;
    }

    &.icon-2 {
      top: 60%;
      right: 20%;
      animation-delay: 2s;
    }

    &.icon-3 {
      bottom: 25%;
      left: 70%;
      animation-delay: 4s;
    }

    &.icon-4 {
      top: 35%;
      right: 15%;
      animation-delay: 6s;
    }

    &.icon-5 {
      bottom: 20%;
      left: 25%;
      animation-delay: 8s;
    }
  }

  // 装饰线条
  .decorative-lines {
    .line {
      position: absolute;
      background: linear-gradient(45deg, rgba(255, 255, 255, 0.03), rgba(102, 126, 234, 0.05));

      &.line-1 {
        width: 2px;
        height: 300px;
        top: 10%;
        left: 30%;
        transform: rotate(15deg);
        animation: lineGlow 8s ease-in-out infinite;
      }

      &.line-2 {
        width: 1px;
        height: 200px;
        top: 40%;
        right: 35%;
        transform: rotate(-20deg);
        animation: lineGlow 10s ease-in-out infinite;
        animation-delay: 2s;
      }

      &.line-3 {
        width: 1.5px;
        height: 150px;
        bottom: 20%;
        left: 60%;
        transform: rotate(45deg);
        animation: lineGlow 6s ease-in-out infinite;
        animation-delay: 4s;
      }
    }
  }

  // 网格背景
  .grid-pattern {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
      linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
      linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 50px 50px;
    opacity: 0.5;
    animation: gridMove 20s linear infinite;
  }

  // 光晕效果
  .light-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(40px);
    animation: orbGlow 15s ease-in-out infinite;

    &.orb-1 {
      width: 400px;
      height: 400px;
      top: -100px;
      left: -100px;
      background: radial-gradient(circle, rgba(102, 126, 234, 0.1) 0%, transparent 70%);
      animation-delay: 0s;
    }

    &.orb-2 {
      width: 300px;
      height: 300px;
      bottom: -80px;
      right: -80px;
      background: radial-gradient(circle, rgba(118, 75, 162, 0.08) 0%, transparent 70%);
      animation-delay: 5s;
    }
  }
}

// 动画关键帧
@keyframes float {
  0%, 100% {
    transform: translateY(0px) rotate(0deg);
  }
  50% {
    transform: translateY(-30px) rotate(180deg);
  }
}

@keyframes iconFloat {
  0%, 100% {
    transform: translateY(0px) scale(1);
    opacity: 0.6;
  }
  33% {
    transform: translateY(-15px) scale(1.1);
    opacity: 0.8;
  }
  66% {
    transform: translateY(-5px) scale(0.9);
    opacity: 0.4;
  }
}

@keyframes lineGlow {
  0%, 100% {
    opacity: 0.2;
    box-shadow: 0 0 5px rgba(102, 126, 234, 0.1);
  }
  50% {
    opacity: 0.6;
    box-shadow: 0 0 20px rgba(102, 126, 234, 0.3);
  }
}

@keyframes gridMove {
  0% {
    transform: translate(0, 0);
  }
  100% {
    transform: translate(50px, 50px);
  }
}

@keyframes orbGlow {
  0%, 100% {
    opacity: 0.3;
    transform: scale(1);
  }
  50% {
    opacity: 0.6;
    transform: scale(1.1);
  }
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}
</style>
